
import pygame, sys, math

class Button(pygame.sprite.Sprite):
    def __init__(self, image, pos, size =(100,100)):
        pygame.sprite.Sprite.__init__(self, self.containers)
        self.image = pygame.image.load(image)
        self.image = pygame.transform.scale(self.image, size)
        self.rect = self.image.get_rect()
        self.place(pos)
        
    def collidePoint(self,pt):
        # print pt, self.rect
        if self.rect.right > pt[0] and self.rect.left < pt[0]:
            if self.rect.bottom > pt[1] and self.rect.top < pt[1]:
                return True
        return False
            
            
    def place(self, pt):
        self.rect.center = pt